Repository navigation
Docs redo phase 2 - #5324
Draft
jamie-lemon wants to merge 9 commits into
Draft
Docs redo phase 2#5324jamie-lemon wants to merge 9 commits into
jamie-lemon wants to merge 9 commits into
Conversation
jamie-lemon
marked this pull request as draft
December 2, 2026 00:34
ilgeunben
reviewed
Dec 2, 2026
ilgeunben
left a comment
Collaborator
There was a problem hiding this comment.
Thanks — automated docs-vs-code check against the PyMuPDF 2.2 wheel (no AI).
Introduced by this PR:
llms/llms.txtline 42 links toclasses/document.html, which is not a page in the docs; the page is nowclasses/document/index.html- 31 pages move to new URLs and 1 page is removed (e.g.
annot.html→classes/annot.html,archive-class.html→classes/archive-class.html,batch-result.html→classes/batch-result.html,document.html(removed)). Without redirects, old links, search results and URLs that AI tools remember will 404.
Already on main, in files this PR touches (optional):
classes/document-writer-class.rst–DocumentWriter.__init__:options: docs defaultNone, code default''llms/llms.txtline 28 links torecipes-ocr.html, which is not a page in the docsllms/llms.txtline 67 links tomodule.html, which is not a page in the docs
Cleanup (pages render, but worth fixing while here):
- Not usable with pymupdf-lite (no Layout engine / pymupdf4llm) — consider a note that the full
pymupdfpackage is needed (6):Document.to_markdown;Document.to_chunks;Document.to_json;Document.to_text;use_layout;convert_batch - Duplicate object descriptions — add
:no-index:to all but one (1): classes/point.rstPoint.__init__
(Ambiguous cross-references are left out, as you're handling them separately.)
Collaborator
Author
|
@ilgeunben FYI: The redirects will all be put in place on the ReadTheDocs portal. I am keeping a list of them going forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Making docs manageable for LLMS ( and people )
A 2,700-line page is too long for an LLM to take in one go. This splits it by task for document.rst
The solution
document.rst holds about 113 methods and 16 attributes, the large summary table, and some example sections at the end. One solution is to turn it into a folder:
That gives 12 pages of roughly 150–350 lines each, and each one answers a single kind of question.
Results: Splitting the Document class page
All of the
DocumentAPI now lives on 12 pages indocs/classes/document/. The docs build with no new warnings: the 9 that remain were there before this change. All 792 links that point into the Document pages were checked and none are broken.__init__,close, general attributes (name,is_pdf,is_dirty,is_closed,is_reflowable,is_repaired,is_fast_webaccess,version_count)to_markdown/to_chunks/to_json/to_text/convert_to_pdf, plus the page-content extractors (get_page_text,search_page_for,extract_image,has_links…), the box-classes note and the image-extraction examplelayout/apply_css, the EPUB location note, the structure-change note, the rotate exampleinsert_pdf,insert_file, theinsert_pdfexamplessave,ez_save,saveIncr,tobytes,can_save_incrementally,subset_fonts,rewrite_images,recolor,scrub,bake,repairresolve_names, viewer settings, theset_metadataandset_tocexamplesis_form_pdf,FormFonts,get_form_fields,recalculate_form,need_appearances,get_sigflagsembfile_*journal_*,save_snapshotneeds_pass,is_encrypted,authenticate,permissionsWhat changed
conversion.rst, the only page that uses them.pymupdf-boxclasses,document_page_boxesandjson_output_structurelabels are on the conversion page, so:ref:links to them still work.to_markdowncode sample now points toclasses/document/conversion.html#pymupdf-boxclasses.document/index.po. Text that moved to the 11 new pages will show in English until the translation files are regenerated and split.Still to do
llms.txt: it still has a single "Document" line. Replacing it with 12 lines, one per page with a short description, is what makes this split pay off for LLMs.document.html#Document.savewill break. A Read the Docs redirect fromclasses/document.htmltoclasses/document/index.htmlplus a small anchor script on the overview would forward each old anchor to its new page.